//
//  ThreadCViewController.m
//  JKRunloopTest
//
//  Created by 王冲 on 2018/10/21.
//  Copyright © 2018年 JK科技有限公司. All rights reserved.
//

#import "ThreadCViewController.h"
#import "JKCPermenantThread.h"
@interface ThreadCViewController ()

@property (strong, nonatomic) JKCPermenantThread *thread;

@end

@implementation ThreadCViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.thread = [[JKCPermenantThread alloc] init];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.thread executeTask:^{
        NSLog(@"执行任务 - %@", [NSThread currentThread]);
    }];
    
    // AFN 2.X 版本
    // 串行
    // 非并发
}

- (void)dealloc
{
    NSLog(@"%s", __func__);
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
